package pestañas;


import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.pdf.draw.DrawInterface;
import java.io.FileOutputStream;
import javax.swing.JProgressBar;
import javax.swing.JTextField;
import vistas.VistaPrincipal;
import com.lowagie.text.Document;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
import java.awt.Color;
import java.awt.Desktop;
import java.io.File;
import java.util.Date;
import javax.swing.JOptionPane;
import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.MinimalBalloonStyle;
import net.java.balloontip.utils.TimingUtils;
import utilidades.ValidaDecimal;
import utilidades.ValoresMetodologiaEstimacion;
import vistas.VistaPrincipal;




/**
 *
 * @author Shidobu
 */
public class PanelPaso4 extends javax.swing.JPanel {

        VistaPrincipal vista;
        String nombreUsuario;
        String fechaInicio;
        String fechaTermino;
        String numeroDesarroll;
        String numeroEvaluadores;
        String horasSoftware;
        String tamSoftware;
        String otrasConsideraciones1;
        String UCE;
        String UNCE;
        String UEX;
        String Empresa;
        String Cliente;
        boolean planillaLista = false;

        /** Creates new form PanelPaso4 */
        public PanelPaso4 () {
                initComponents ();
                jPanelCostoEvaluacion.setVisible (false);
                jPanelCostoReparacion.setVisible (false);
        }

        public void setVista (VistaPrincipal vista) {
                this.vista = vista;
                this.fechaInicio = (String) jCalendarComboFechaInicio.getSelectedItem ();
                this.fechaTermino = (String) jCalendarComboFechaTermino.getSelectedItem ();
        }

        //Métodos para ABRIR y para LIMPIAR
        public void setEvaluadorExpertoValorHH (String valor) {
                this.jTextFieldEvaluadorExpertoValorHH.setText (valor);
        }

        public void setEvaluadorExpertoHorasEvaluacion (String valor) {
                this.jTextFieldEvaluadorExpertoHorasEvaluacion.setText (valor);
        }

        public void setUsuarioEvaluadorValorHH (String valor) {
                this.jTextFieldUsuarioEvaluadorValorHH.setText (valor);
        }

        public void setUsuarioEvaluadorHorasEvaluacion (String valor) {
                this.jTextFieldUsuarioEvaluadorHorasEvaluacion.setText (valor);
        }

        public void setValorOtrosCostos (String valor) {
                this.jTextFieldValorOtrosCostos.setText (valor);
        }

        public void setTotalCostoEvaluacionPesos (String valor) {
                this.jTextFieldTotalCostoEvaluacionPesos.setText (valor);
        }

        public void setTotalCostoEvaluacionUF (String valor) {
                this.jTextFieldTotalCostoEvaluacionUF.setText (valor);
        }

        public void setDesarrolladorValorHH (String valor) {
                this.jTextFieldDesarrolladorValorHH.setText (valor);
        }

        public void setDesarrolladorHorasReparacion (String valor) {
                this.jTextFieldDesarrolladorHorasReparacion.setText (valor);
        }

        public void setTotalCostoReparacionPesos (String valor) {
                this.jTextFieldTotalCostoReparacionPesos.setText (valor);
        }

        public void setTotalCostoReparacionUF (String valor) {
                this.jTextFieldTotalCostoReparacionUF.setText (valor);
        }

        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings ("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelFechas = new javax.swing.JPanel();
        jLabelFechaInicio = new javax.swing.JLabel();
        jLabelFechaTermino = new javax.swing.JLabel();
        jCalendarComboFechaInicio = new org.freixas.jcalendar.JCalendarCombo();
        jCalendarComboFechaTermino = new org.freixas.jcalendar.JCalendarCombo();
        jButtonMostrarCampos = new javax.swing.JButton();
        jPanelCostoEvaluacion = new javax.swing.JPanel();
        jPanelUsuarioEvaluador = new javax.swing.JPanel();
        jLabelUsuarioEvaluadorValorHH = new javax.swing.JLabel();
        jLabelUsuarioEvaluadorHorasEvaluacion = new javax.swing.JLabel();
        jTextFieldUsuarioEvaluadorValorHH = new javax.swing.JTextField();
        jTextFieldUsuarioEvaluadorHorasEvaluacion = new javax.swing.JTextField();
        jPanelOtrosCostos = new javax.swing.JPanel();
        jLabelValorOtrosCostos = new javax.swing.JLabel();
        jTextFieldValorOtrosCostos = new javax.swing.JTextField();
        jPanelTotalCostoEvaluacion = new javax.swing.JPanel();
        jLabelTotalCostoEvaluacionPesos = new javax.swing.JLabel();
        jLabelTotalCostoEvaluacionUF = new javax.swing.JLabel();
        jTextFieldTotalCostoEvaluacionPesos = new javax.swing.JTextField();
        jTextFieldTotalCostoEvaluacionUF = new javax.swing.JTextField();
        jPanelEvaluadorExperto = new javax.swing.JPanel();
        jLabelEvaluadorExpertoValorHH = new javax.swing.JLabel();
        jLabelEvaluadorExpertoHorasEvaluacion = new javax.swing.JLabel();
        jTextFieldEvaluadorExpertoHorasEvaluacion = new javax.swing.JTextField();
        jTextFieldEvaluadorExpertoValorHH = new javax.swing.JTextField();
        jPanelCostoReparacion = new javax.swing.JPanel();
        jPanelReparacionDesarrollador = new javax.swing.JPanel();
        jLabelReparacionDesarrolladorValorHH = new javax.swing.JLabel();
        jLabelReparacionDesarrolladorHorasReparacion = new javax.swing.JLabel();
        jTextFieldDesarrolladorValorHH = new javax.swing.JTextField();
        jTextFieldDesarrolladorHorasReparacion = new javax.swing.JTextField();
        jPanelTotalCostoReparacion = new javax.swing.JPanel();
        jTextFieldTotalCostoReparacionPesos = new javax.swing.JTextField();
        jLabelTotalCostoEvaluacionPesos1 = new javax.swing.JLabel();
        jLabelTotalCostoEvaluacionUF1 = new javax.swing.JLabel();
        jTextFieldTotalCostoReparacionUF = new javax.swing.JTextField();
        jButtonReporte = new javax.swing.JButton();

        setMaximumSize(new java.awt.Dimension(595, 540));
        setMinimumSize(new java.awt.Dimension(595, 540));
        setPreferredSize(new java.awt.Dimension(595, 540));

        jPanelFechas.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanelFechas.setMaximumSize(new java.awt.Dimension(575, 77));
        jPanelFechas.setMinimumSize(new java.awt.Dimension(575, 77));
        jPanelFechas.setPreferredSize(new java.awt.Dimension(575, 77));

        jLabelFechaInicio.setFont(new java.awt.Font("Tahoma 11 Negrita 12 Simple", 1, 12));
        jLabelFechaInicio.setText("Fecha Inicio:");

        jLabelFechaTermino.setFont(new java.awt.Font("Tahoma 11 Negrita 12 Simple", 1, 12));
        jLabelFechaTermino.setText("Fecha Término:");

        jCalendarComboFechaInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCalendarComboFechaInicioActionPerformed(evt);
            }
        });

        jCalendarComboFechaTermino.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCalendarComboFechaTerminoActionPerformed(evt);
            }
        });

        jButtonMostrarCampos.setText("Mostrar todos los campos");
        jButtonMostrarCampos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonMostrarCamposActionPerformed(evt);
            }
        });
        //GRUPO4 Prevención de errores 7 --> botón innecesario
        jButtonMostrarCampos.setVisible(false);

        javax.swing.GroupLayout jPanelFechasLayout = new javax.swing.GroupLayout(jPanelFechas);
        jPanelFechas.setLayout(jPanelFechasLayout);
        jPanelFechasLayout.setHorizontalGroup(
            jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelFechasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelFechaTermino)
                    .addComponent(jLabelFechaInicio))
                .addGap(18, 18, 18)
                .addGroup(jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCalendarComboFechaTermino, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCalendarComboFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(51, 51, 51)
                .addComponent(jButtonMostrarCampos, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(61, 61, 61))
        );
        jPanelFechasLayout.setVerticalGroup(
            jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFechasLayout.createSequentialGroup()
                .addGroup(jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelFechasLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCalendarComboFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelFechasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelFechaTermino)
                            .addComponent(jCalendarComboFechaTermino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelFechasLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(jButtonMostrarCampos)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelCostoEvaluacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Costo Evaluación", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), null)); // NOI18N
        jPanelCostoEvaluacion.setMaximumSize(new java.awt.Dimension(575, 209));
        jPanelCostoEvaluacion.setMinimumSize(new java.awt.Dimension(575, 209));

        jPanelUsuarioEvaluador.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Usuario Evaluador", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N
        jPanelUsuarioEvaluador.setMaximumSize(new java.awt.Dimension(268, 88));
        jPanelUsuarioEvaluador.setMinimumSize(new java.awt.Dimension(268, 88));
        jPanelUsuarioEvaluador.setPreferredSize(new java.awt.Dimension(268, 88));

        jLabelUsuarioEvaluadorValorHH.setText("Valor HH:");

        jLabelUsuarioEvaluadorHorasEvaluacion.setText("Horas de Evaluación:");

        jTextFieldUsuarioEvaluadorValorHH.setEnabled(false);
        jTextFieldUsuarioEvaluadorValorHH.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldUsuarioEvaluadorValorHH.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldUsuarioEvaluadorValorHH.setPreferredSize(new java.awt.Dimension(100, 20));

        jTextFieldUsuarioEvaluadorHorasEvaluacion.setEnabled(false);
        jTextFieldUsuarioEvaluadorHorasEvaluacion.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldUsuarioEvaluadorHorasEvaluacion.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldUsuarioEvaluadorHorasEvaluacion.setPreferredSize(new java.awt.Dimension(100, 20));

        javax.swing.GroupLayout jPanelUsuarioEvaluadorLayout = new javax.swing.GroupLayout(jPanelUsuarioEvaluador);
        jPanelUsuarioEvaluador.setLayout(jPanelUsuarioEvaluadorLayout);
        jPanelUsuarioEvaluadorLayout.setHorizontalGroup(
            jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelUsuarioEvaluadorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabelUsuarioEvaluadorValorHH, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelUsuarioEvaluadorHorasEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
                .addGap(14, 14, 14)
                .addGroup(jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldUsuarioEvaluadorHorasEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldUsuarioEvaluadorValorHH, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(22, Short.MAX_VALUE))
        );
        jPanelUsuarioEvaluadorLayout.setVerticalGroup(
            jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelUsuarioEvaluadorLayout.createSequentialGroup()
                .addGroup(jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelUsuarioEvaluadorValorHH)
                    .addComponent(jTextFieldUsuarioEvaluadorValorHH, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelUsuarioEvaluadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelUsuarioEvaluadorHorasEvaluacion)
                    .addComponent(jTextFieldUsuarioEvaluadorHorasEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jPanelOtrosCostos.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Otros Costos"));
        jPanelOtrosCostos.setMaximumSize(new java.awt.Dimension(239, 77));
        jPanelOtrosCostos.setMinimumSize(new java.awt.Dimension(239, 77));

        jLabelValorOtrosCostos.setText("Valor de otros costos:");

        jTextFieldValorOtrosCostos.setEnabled(false);
        jTextFieldValorOtrosCostos.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldValorOtrosCostos.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldValorOtrosCostos.setPreferredSize(new java.awt.Dimension(90, 20));

        javax.swing.GroupLayout jPanelOtrosCostosLayout = new javax.swing.GroupLayout(jPanelOtrosCostos);
        jPanelOtrosCostos.setLayout(jPanelOtrosCostosLayout);
        jPanelOtrosCostosLayout.setHorizontalGroup(
            jPanelOtrosCostosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelOtrosCostosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelValorOtrosCostos)
                .addGap(18, 18, 18)
                .addComponent(jTextFieldValorOtrosCostos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );
        jPanelOtrosCostosLayout.setVerticalGroup(
            jPanelOtrosCostosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelOtrosCostosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelOtrosCostosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelValorOtrosCostos)
                    .addComponent(jTextFieldValorOtrosCostos, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(20, Short.MAX_VALUE))
        );

        jPanelTotalCostoEvaluacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Total Costo Evaluación"));
        jPanelTotalCostoEvaluacion.setMaximumSize(new java.awt.Dimension(211, 77));
        jPanelTotalCostoEvaluacion.setMinimumSize(new java.awt.Dimension(211, 77));

        jLabelTotalCostoEvaluacionPesos.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostoEvaluacionPesos.setText("En Pesos ($)");

        jLabelTotalCostoEvaluacionUF.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostoEvaluacionUF.setText("En UF");

        jTextFieldTotalCostoEvaluacionPesos.setEnabled(false);
        jTextFieldTotalCostoEvaluacionPesos.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoEvaluacionPesos.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoEvaluacionPesos.setPreferredSize(new java.awt.Dimension(90, 20));

        jTextFieldTotalCostoEvaluacionUF.setEnabled(false);
        jTextFieldTotalCostoEvaluacionUF.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoEvaluacionUF.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoEvaluacionUF.setPreferredSize(new java.awt.Dimension(90, 20));

        javax.swing.GroupLayout jPanelTotalCostoEvaluacionLayout = new javax.swing.GroupLayout(jPanelTotalCostoEvaluacion);
        jPanelTotalCostoEvaluacion.setLayout(jPanelTotalCostoEvaluacionLayout);
        jPanelTotalCostoEvaluacionLayout.setHorizontalGroup(
            jPanelTotalCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTotalCostoEvaluacionLayout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(jPanelTotalCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldTotalCostoEvaluacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalCostoEvaluacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelTotalCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldTotalCostoEvaluacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalCostoEvaluacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        jPanelTotalCostoEvaluacionLayout.setVerticalGroup(
            jPanelTotalCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTotalCostoEvaluacionLayout.createSequentialGroup()
                .addGroup(jPanelTotalCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelTotalCostoEvaluacionLayout.createSequentialGroup()
                        .addComponent(jLabelTotalCostoEvaluacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTextFieldTotalCostoEvaluacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelTotalCostoEvaluacionLayout.createSequentialGroup()
                        .addComponent(jLabelTotalCostoEvaluacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTextFieldTotalCostoEvaluacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanelEvaluadorExperto.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Evaluador Experto", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N
        jPanelEvaluadorExperto.setMaximumSize(new java.awt.Dimension(268, 88));
        jPanelEvaluadorExperto.setMinimumSize(new java.awt.Dimension(268, 88));
        jPanelEvaluadorExperto.setPreferredSize(new java.awt.Dimension(268, 88));
        jPanelEvaluadorExperto.setRequestFocusEnabled(false);

        jLabelEvaluadorExpertoValorHH.setText("Valor HH:");

        jLabelEvaluadorExpertoHorasEvaluacion.setText("Horas de Evaluación:");

        jTextFieldEvaluadorExpertoHorasEvaluacion.setEnabled(false);
        jTextFieldEvaluadorExpertoHorasEvaluacion.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldEvaluadorExpertoHorasEvaluacion.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldEvaluadorExpertoHorasEvaluacion.setPreferredSize(new java.awt.Dimension(100, 20));

        jTextFieldEvaluadorExpertoValorHH.setEnabled(false);
        jTextFieldEvaluadorExpertoValorHH.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldEvaluadorExpertoValorHH.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldEvaluadorExpertoValorHH.setPreferredSize(new java.awt.Dimension(100, 20));

        javax.swing.GroupLayout jPanelEvaluadorExpertoLayout = new javax.swing.GroupLayout(jPanelEvaluadorExperto);
        jPanelEvaluadorExperto.setLayout(jPanelEvaluadorExpertoLayout);
        jPanelEvaluadorExpertoLayout.setHorizontalGroup(
            jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEvaluadorExpertoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelEvaluadorExpertoValorHH, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                    .addComponent(jLabelEvaluadorExpertoHorasEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldEvaluadorExpertoHorasEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldEvaluadorExpertoValorHH, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28))
        );
        jPanelEvaluadorExpertoLayout.setVerticalGroup(
            jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEvaluadorExpertoLayout.createSequentialGroup()
                .addGroup(jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelEvaluadorExpertoValorHH)
                    .addComponent(jTextFieldEvaluadorExpertoValorHH, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelEvaluadorExpertoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelEvaluadorExpertoHorasEvaluacion)
                    .addComponent(jTextFieldEvaluadorExpertoHorasEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelCostoEvaluacionLayout = new javax.swing.GroupLayout(jPanelCostoEvaluacion);
        jPanelCostoEvaluacion.setLayout(jPanelCostoEvaluacionLayout);
        jPanelCostoEvaluacionLayout.setHorizontalGroup(
            jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostoEvaluacionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanelOtrosCostos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelEvaluadorExperto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelTotalCostoEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelUsuarioEvaluador, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelCostoEvaluacionLayout.setVerticalGroup(
            jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostoEvaluacionLayout.createSequentialGroup()
                .addGroup(jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelEvaluadorExperto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelUsuarioEvaluador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelCostoEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelTotalCostoEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelOtrosCostos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanelCostoReparacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Costo Reparación", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), null)); // NOI18N
        jPanelCostoReparacion.setMaximumSize(new java.awt.Dimension(575, 115));
        jPanelCostoReparacion.setMinimumSize(new java.awt.Dimension(575, 115));

        jPanelReparacionDesarrollador.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Desarrollador", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), null)); // NOI18N
        jPanelReparacionDesarrollador.setMaximumSize(new java.awt.Dimension(232, 83));
        jPanelReparacionDesarrollador.setMinimumSize(new java.awt.Dimension(232, 83));

        jLabelReparacionDesarrolladorValorHH.setText("Valor HH:");

        jLabelReparacionDesarrolladorHorasReparacion.setText("Horas de Reparación:");

        jTextFieldDesarrolladorValorHH.setEnabled(false);
        jTextFieldDesarrolladorValorHH.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldDesarrolladorValorHH.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldDesarrolladorValorHH.setPreferredSize(new java.awt.Dimension(90, 20));

        jTextFieldDesarrolladorHorasReparacion.setEnabled(false);
        jTextFieldDesarrolladorHorasReparacion.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldDesarrolladorHorasReparacion.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldDesarrolladorHorasReparacion.setPreferredSize(new java.awt.Dimension(90, 20));

        javax.swing.GroupLayout jPanelReparacionDesarrolladorLayout = new javax.swing.GroupLayout(jPanelReparacionDesarrollador);
        jPanelReparacionDesarrollador.setLayout(jPanelReparacionDesarrolladorLayout);
        jPanelReparacionDesarrolladorLayout.setHorizontalGroup(
            jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelReparacionDesarrolladorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabelReparacionDesarrolladorValorHH, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelReparacionDesarrolladorHorasReparacion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldDesarrolladorValorHH, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldDesarrolladorHorasReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(36, Short.MAX_VALUE))
        );
        jPanelReparacionDesarrolladorLayout.setVerticalGroup(
            jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelReparacionDesarrolladorLayout.createSequentialGroup()
                .addGroup(jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelReparacionDesarrolladorValorHH)
                    .addComponent(jTextFieldDesarrolladorValorHH, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelReparacionDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelReparacionDesarrolladorHorasReparacion)
                    .addComponent(jTextFieldDesarrolladorHorasReparacion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelTotalCostoReparacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Total Costo Reparación"));
        jPanelTotalCostoReparacion.setMaximumSize(new java.awt.Dimension(222, 77));
        jPanelTotalCostoReparacion.setMinimumSize(new java.awt.Dimension(222, 77));

        jTextFieldTotalCostoReparacionPesos.setEnabled(false);
        jTextFieldTotalCostoReparacionPesos.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoReparacionPesos.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoReparacionPesos.setPreferredSize(new java.awt.Dimension(90, 20));

        jLabelTotalCostoEvaluacionPesos1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostoEvaluacionPesos1.setText("En Pesos ($)");

        jLabelTotalCostoEvaluacionUF1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostoEvaluacionUF1.setText("En UF");

        jTextFieldTotalCostoReparacionUF.setEnabled(false);
        jTextFieldTotalCostoReparacionUF.setMaximumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoReparacionUF.setMinimumSize(new java.awt.Dimension(90, 20));
        jTextFieldTotalCostoReparacionUF.setPreferredSize(new java.awt.Dimension(90, 20));

        javax.swing.GroupLayout jPanelTotalCostoReparacionLayout = new javax.swing.GroupLayout(jPanelTotalCostoReparacion);
        jPanelTotalCostoReparacion.setLayout(jPanelTotalCostoReparacionLayout);
        jPanelTotalCostoReparacionLayout.setHorizontalGroup(
            jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTotalCostoReparacionLayout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldTotalCostoReparacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalCostoEvaluacionPesos1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldTotalCostoReparacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalCostoEvaluacionUF1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        jPanelTotalCostoReparacionLayout.setVerticalGroup(
            jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTotalCostoReparacionLayout.createSequentialGroup()
                .addGroup(jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalCostoEvaluacionPesos1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalCostoEvaluacionUF1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelTotalCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldTotalCostoReparacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldTotalCostoReparacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanelCostoReparacionLayout = new javax.swing.GroupLayout(jPanelCostoReparacion);
        jPanelCostoReparacion.setLayout(jPanelCostoReparacionLayout);
        jPanelCostoReparacionLayout.setHorizontalGroup(
            jPanelCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostoReparacionLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelReparacionDesarrollador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelTotalCostoReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanelCostoReparacionLayout.setVerticalGroup(
            jPanelCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostoReparacionLayout.createSequentialGroup()
                .addGroup(jPanelCostoReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelTotalCostoReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelReparacionDesarrollador, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jButtonReporte.setText("Generar Reporte");
        jButtonReporte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReporteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelCostoReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelCostoEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelFechas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonReporte, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelFechas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelCostoEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelCostoReparacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButtonReporte)
                .addContainerGap(75, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

        // GRUPO4 Prevención de errores 7: Habilitar los campos necesarios para generar el reporte
        public void prepararPaso4()
        {
            planillaLista = true;
            calcularValores ();
            mostrarPaneles ();
        }
        // Fin GRUPO4

        /*
         * GRUPO4 Prevención errores 5: Validar que la fecha de termino sea posterior a la fecha de inicio
         */
        boolean validafechas()
        {
            Date fechaInicio= jCalendarComboFechaInicio.getDate();
            Date fechaTermino= jCalendarComboFechaTermino.getDate();

            float tiempoInicio= fechaInicio.getTime();
            float tiempoTermino= fechaTermino.getTime();

            float diferencia= tiempoTermino-tiempoInicio;

            if(diferencia<0)
                return false;
            else
                return true;
        }
        // Fin GRUPO4

  
    private void jButtonReporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReporteActionPerformed

        /*
         * GRUPO4 Prevención de errores 5 --> Se valida las fechas de término e inicio de la evaluación
         */

        if(!validafechas())
        {
            JOptionPane.showMessageDialog(null, "La fecha de término debe ser posterior a la fecha de inicio");
            return;
        }

        // Fin GRUPO4

        //Obtener datos del cliente

        nombreUsuario = vista.usuario();
        
        Cliente = vista.getNombreCliente();

        Empresa = vista.getEmpresa();
      

        //GRUPO 1 TRABAJANDO EN PDF---------------------------------------------
        Document documento = new Document ();

        PanelPaso1 panelPaso1 = vista.getPanelPaso1 ();
        PanelPaso2 panelPaso2 = vista.getPanelPaso2 ();
        ValoresMetodologiaEstimacion vme = new ValoresMetodologiaEstimacion();

        this.setNumeroEvaluadores(panelPaso1.getJTextFieldTotalUsuarios().getText());
        this.setNumeroDesarroll(panelPaso2.getJTextFieldValorNumeroDesarrolladores().getText());
        this.setHorasSoftware(panelPaso1.getJTextFieldHorasTamañoSoftware().getText());
		try {
			PdfWriter.getInstance (documento, new FileOutputStream ("Reporte.pdf"));
			documento.open ();

                        PdfPCell cell;

                        //Cabecera documento: (logo reusa) (titulo: Reporte Cotización)
                        Font title = new Font(Font.HELVETICA, 18, Font.BOLD,new Color(0x00, 0x64, 0x00)); //verde bold
                        Font title1 = new Font(Font.HELVETICA, 13, Font.BOLD,new Color(0x00, 0x64, 0x00)); //verde bold
                        Font title2 = new Font(Font.HELVETICA, 10, Font.NORMAL,new Color(0x00, 0x64, 0x00)); //verde normal
                        Font title2_ = new Font(Font.HELVETICA, 12, Font.NORMAL,new Color(0x7F, 0xFF, 0x00)); //verde normal
                        Font title3 = new Font(Font.HELVETICA, 10, Font.NORMAL,new Color(0x00, 0x00, 0x00));//negro bormal
                        Font title4 = new Font(Font.HELVETICA, 10, Font.BOLD,new Color(0x00, 0x00, 0x00));//negro bold
                        Font title5 = new Font(Font.HELVETICA, 8, Font.ITALIC,new Color(0x00, 0x00, 0x00));
                        Font total = new Font(Font.HELVETICA, 10, Font.NORMAL, new Color(0xff, 0xff, 0xff));

                        documento.add (new Paragraph ("\n\n"));
                        
                        Image imagen = Image.getInstance("REUSA.png");
                        Chunk titulo = new Chunk("              Cotización de Usabilidad", title);
                        Chunk subtitulo = new Chunk(nombreUsuario, title2_);
                        Chunk reusa = new Chunk(imagen, 40, -14);
                        Paragraph p = new Paragraph(reusa);
                        p.add(titulo);
                        p.add("\n                                                    ");
                        p.add(subtitulo);
                        documento.add (p);

                        //DATOS DEL CLIENTE
                        documento.add (new Paragraph ("\n\n\n"));
                        documento.addTitle("REUSA");

                        PdfPTable table = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Datos del Cliente", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);

                        table.addCell(cell);

                        cell = new PdfPCell(new Paragraph("Cliente: " + Cliente, title4));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table.addCell(cell);

                        cell = new PdfPCell(new Paragraph("Empresa: " + Empresa, title4));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table.addCell(cell);

                        documento.add(table);
                        documento.add (new Paragraph ("\n\n"));

                        //Sección Período de Cotización
                        PdfPTable table2 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Período de Cotización: ", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table2.addCell(cell);
                        documento.add(table2);

                        //fechas del periodo
                        PdfPTable table3 = new PdfPTable(1);
                        Paragraph p2 = new Paragraph("Desde el ", title2);
                        Chunk c3 = new Chunk(fechaInicio, title3);
                        Chunk c4 = new Chunk(" al ", title2);
                        Chunk c5 = new Chunk(fechaTermino, title3);
                        p2.add(c3);
                        p2.add(c4);
                        p2.add(c5);
                        cell = new PdfPCell(p2);
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table3.addCell(cell);

                        documento.add(table3);
                        documento.add (new Paragraph ("\n\n"));

                        //Sección Costo de evaluación y análisis de la aplicación
                        PdfPTable table4 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Costo de evaluación y análisis de la aplicación ", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table4.addCell(cell);
                        documento.add(table4);
                        documento.add (new Paragraph ("\n"));

                        //Valor HH - Evaluador Experto
                        PdfPTable table5 = new PdfPTable(2);
                        table5.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cell = new PdfPCell(new Paragraph("Valor HH - Evaluador Experto", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldEvaluadorExpertoValorHH.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);

                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table5.addCell(cell);

                        //Horas de Evaluación
                        cell = new PdfPCell(new Paragraph("Horas de Evaluación", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldEvaluadorExpertoHorasEvaluacion.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table5.addCell(cell);

                        //Valor HH - Usuarios Evaluadores
                        cell = new PdfPCell(new Paragraph("Valor HH - Usuarios Evaluadores", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldUsuarioEvaluadorValorHH.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table5.addCell(cell);

                        //Horas de Evaluacion
                        cell = new PdfPCell(new Paragraph("Horas de Evaluacion", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldUsuarioEvaluadorHorasEvaluacion.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table5.addCell(cell);

                        //Otros Costos Involucrados
                        cell = new PdfPCell(new Paragraph("Otros Costos Involucrados", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldValorOtrosCostos.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table5.addCell(cell);

                        //Separador de totales
                        cell = new PdfPCell(new Paragraph("", title2));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph("", title2));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table5.addCell(cell);

                        //Total en UF
                        cell = new PdfPCell(new Paragraph("Total en UF", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldTotalCostoEvaluacionUF.getText (), total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        cell.setBackgroundColor(Color.black);
                        table5.addCell(cell);

                        //Total en pesos
                        cell = new PdfPCell(new Paragraph("Total en pesos", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table5.addCell(cell);

                        cell = new PdfPCell(new Paragraph("$" + (String) this.jTextFieldTotalCostoEvaluacionPesos.getText (), total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        cell.setBackgroundColor(Color.black);
                        table5.addCell(cell);

                        documento.add(table5);
                        documento.add (new Paragraph ("\n\n"));

                        //Sección Costo de Reparación
                        PdfPTable table6 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Costo de Reparación ", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table6.addCell(cell);

                        documento.add(table6);
                        documento.add (new Paragraph ("\n"));

                        //Valor HH - Desarrollador
                        PdfPTable table7 = new PdfPTable(2);
                        table7.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cell = new PdfPCell(new Paragraph("Valor HH - Desarrollador", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table7.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldDesarrolladorValorHH.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table7.addCell(cell);

                        //Horas de Reparación
                        cell = new PdfPCell(new Paragraph("Horas de Reparación", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table7.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldDesarrolladorHorasReparacion.getText (), title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table7.addCell(cell);

                        //Separador de totales
                        cell = new PdfPCell(new Paragraph("", title2));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table7.addCell(cell);

                        cell = new PdfPCell(new Paragraph("", title2));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table7.addCell(cell);

                        //Total en UF
                        cell = new PdfPCell(new Paragraph("Total en UF", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table7.addCell(cell);

                        cell = new PdfPCell(new Paragraph((String) this.jTextFieldTotalCostoReparacionUF.getText (), total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        cell.setBackgroundColor(Color.black);
                        table7.addCell(cell);

                        //Total en pesos
                        cell = new PdfPCell(new Paragraph("Total en pesos", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table7.addCell(cell);

                        cell = new PdfPCell(new Paragraph("$" + (String) this.jTextFieldTotalCostoReparacionPesos.getText (), total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setBackgroundColor(Color.black);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table7.addCell(cell);

                        documento.add(table7);
                        documento.add (new Paragraph ("\n\n\n\n"));

                        //sección costo total
                        PdfPTable table8 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Costo Total", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setBorderColorBottom(Color.black);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table8.addCell(cell);

                        documento.add(table8);
                        documento.add(new Paragraph("\n"));

                         PdfPTable table9 = new PdfPTable(2);

                        cell = new PdfPCell(new Paragraph("Total en UF", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table9.addCell(cell);

                        double TOTAL_UF = Double.parseDouble(jTextFieldTotalCostoReparacionUF.getText())
                                        + Double.parseDouble(jTextFieldTotalCostoEvaluacionUF.getText());
                        String TOTALUF = TOTAL_UF+"";
                        cell = new PdfPCell(new Paragraph(TOTALUF, total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        cell.setBackgroundColor(Color.black);
                        table9.addCell(cell);

                        cell = new PdfPCell(new Paragraph("Total en pesos", total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        cell.setBackgroundColor(Color.black);
                        table9.addCell(cell);
                        double TOTAL_PESOS = Double.parseDouble(jTextFieldTotalCostoReparacionPesos.getText())
                                        + Double.parseDouble(jTextFieldTotalCostoEvaluacionPesos.getText());
                        String TOTALPESOS = TOTAL_PESOS+"";
                        cell = new PdfPCell(new Paragraph("$" + TOTALPESOS, total));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setBackgroundColor(Color.black);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table9.addCell(cell);

                        documento.add(table9);

                        documento.add(new Paragraph("\n"));

/*Fin primera página del reporte--------------------------------------------------------*/
                        documento.newPage();
/*nueva página del reporte--------------------------------------------------------*/

                        documento.add(new Paragraph("\n\n\n\n"));

			//Sección detalles de Costo de evaluación y análisis de la aplicación
                        PdfPTable table10 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Detalles Costo de evaluación y análisis de la aplicación ", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table10.addCell(cell);
                        documento.add(table10);

                        documento.add (new Paragraph ("\n"));

                        //detalle Número de Usuarios Evaluadores
                        PdfPTable table11 = new PdfPTable(2);
                        table11.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cell = new PdfPCell(new Paragraph("Número de Usuarios Evaluadores", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table11.addCell(cell);

                        cell = new PdfPCell(new Paragraph(numeroEvaluadores, title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table11.addCell(cell);

                        //detalle Tamaño del Software
                        cell = new PdfPCell(new Paragraph("Tamaño del Software", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table11.addCell(cell);

                        cell = new PdfPCell(new Paragraph(horasSoftware, title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table11.addCell(cell);

                        documento.add(table11);
                        documento.add (new Paragraph ("\n\n"));

                        //Sección Detalles Costo de Reparación
			PdfPTable table12 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Detalles Costo de Reparación", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table12.addCell(cell);
                        documento.add(table12);

                        documento.add (new Paragraph ("\n"));

                        PdfPTable table13 = new PdfPTable(2);
                        table13.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cell = new PdfPCell(new Paragraph("Número de Desarrolladores", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table13.addCell(cell);

                        cell = new PdfPCell(new Paragraph(numeroDesarroll, title3));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                        table13.addCell(cell);

                        //detalle Tamaño del Software
                        cell = new PdfPCell(new Paragraph("Tamaño del Software", title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table13.addCell(cell);

                        if(horasSoftware != null && horasSoftware.length() > 0 && Integer.parseInt(horasSoftware)== vme.getHorasPorSoftwarePequeño())
                        {
                           cell = new PdfPCell(new Paragraph("Software de Tamaño Pequeño", title3));
                            //cell.setBorder(PdfPCell.NO_BORDER);
                            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                            table13.addCell(cell);

                        }
                        else if(horasSoftware != null && horasSoftware.length() > 0 && Integer.parseInt(horasSoftware)== vme.getHorasPorSoftwareMediano())
                        {
                            cell = new PdfPCell(new Paragraph("Software de Tamaño Medio", title3));
                            //cell.setBorder(PdfPCell.NO_BORDER);
                            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                            table13.addCell(cell);
                        }
                        else if(horasSoftware != null && horasSoftware.length() > 0 && Integer.parseInt(horasSoftware)>= 65)
                        {
                            cell = new PdfPCell(new Paragraph("Software de Tamaño Grande", title3));
                            //cell.setBorder(PdfPCell.NO_BORDER);
                            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                            table13.addCell(cell);
                        }
                        else
                        {
                            cell = new PdfPCell(new Paragraph("Tamaño por Determinar", title3));
                            //cell.setBorder(PdfPCell.NO_BORDER);
                            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                            table13.addCell(cell);
                        }

                        documento.add(table13);
                        documento.add (new Paragraph ("\n\n"));

			//Sección Otras Consideraciones
                        PdfPTable table14 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("Otras Consideraciones", title1));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table14.addCell(cell);

                        documento.add(table14);
			documento.add (new Paragraph ("\n"));

                        //Detalles modalidades de usuario
                        PdfPTable table15 = new PdfPTable(2);
                        table15.setHorizontalAlignment(Element.ALIGN_CENTER);
                        cell = new PdfPCell(new Paragraph(otrasConsideraciones1, title2));
                        //cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                        table15.addCell(cell);


                         if(UCE.equals("0")&& UNCE.equals("0")&& UEX.equals("0"))
                         {
                            cell = new PdfPCell(new Paragraph("No se ha especificado modalidad de usuarios evaluadores", title3));
                            //cell.setBorder(PdfPCell.NO_BORDER);
                            cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                            table15.addCell(cell);
                          }
                        else if(UNCE.equals("0")&& UCE.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("El cliente compromete personal de su empresa como usuarios evaluadores", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else if(UCE.equals("0")&& UEX.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("El evaluador experto conseguirá personal de la empresa del cliente como usuarios evaluadores", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else if(UCE.equals("0")&& UNCE.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("Se utilizará mano de obra externa como usuarios evaluadores", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else if(UEX.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("Se utilizará una mezcla de usuarios de la empresa del cliente (comprometidos y no comprometidos) como usuarios evaluadores", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else if(UNCE.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("El cliente se compromete con personal de su empresa como usuarios evaluadores, pero también se utilizará mano de obra externa", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else if(UCE.equals("0"))
                        {
                            cell = new PdfPCell(new Paragraph("Los usuarios evaluadores serán personal de la empresa del cliente y mano de obra externa, pero el cliente no asume responsabilidad en el pago del servicio", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }
                        else
                        {
                             cell = new PdfPCell(new Paragraph("No existe esa modalidad de usuarios", title3));
                                        //cell.setBorder(PdfPCell.NO_BORDER);
                                        cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
                                        table15.addCell(cell);
                        }

                        documento.add(table15);

                        documento.add(new Paragraph("\n\n\n\n\n\n"));

                        //sección información extra
                        PdfPTable table16 = new PdfPTable(1);
                        cell = new PdfPCell(new Paragraph("- El presupuesto esta sujeto a confirmación", title5));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table16.addCell(cell);
                                                        //
                        cell = new PdfPCell(new Paragraph("- Cotización válida durante los próximos 15 días hábiles", title5));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table16.addCell(cell);

                        cell = new PdfPCell(new Paragraph("- Cotización realizada utilizando la cuenta " + nombreUsuario, title5));
                        cell.setBorder(PdfPCell.NO_BORDER);
                        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                        table16.addCell(cell);


                        documento.add(table16);

                        } catch (Exception e) {
                                        JOptionPane.showMessageDialog (null, "No se pudo generar Reporte.pdf", "Error", JOptionPane.ERROR_MESSAGE);
                                        return;
                        }

                documento.close ();

                //Abre documento
                try {
                        Desktop.getDesktop ().open (new File ("Reporte.pdf"));
                } catch (Exception e) {
                        JOptionPane.showMessageDialog (null, "No se pudo abrir Reporte.pdf", "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                }


        }

    /*    Document documento = new Document ();

        PanelPaso1 panelPaso1 = vista.getPanelPaso1 ();
        PanelPaso2 panelPaso2 = vista.getPanelPaso2 ();
        ValoresMetodologiaEstimacion vme = new ValoresMetodologiaEstimacion();

        this.setNumeroEvaluadores(panelPaso1.getJTextFieldTotalUsuarios().getText());
        this.nombreUsuario = vista.usuario();
        this.setNumeroDesarroll(panelPaso2.getJTextFieldValorNumeroDesarrolladores().getText());
        this.setHorasSoftware(panelPaso1.getJTextFieldHorasTamañoSoftware().getText());
                try {
                        PdfWriter.getInstance (documento, new FileOutputStream ("Reporte.pdf"));
                        documento.open ();

                        PdfPCell cell;

     //Fin GRUPO 1 TRABAJANDO EN PDF---------------------------------------------
                       
     * */
     
//FIN GRUPO 1 TRABAJANDO EN PDF---------------------------------------------
        public JTextField getJTextFieldDesarrolladorHorasReparacion () {
                return jTextFieldDesarrolladorHorasReparacion;
        }

        public JTextField getJTextFieldDesarrolladorValorHH () {
                return jTextFieldDesarrolladorValorHH;
        }

        public JTextField getJTextFieldEvaluadorExpertoHorasEvaluacion () {
                return jTextFieldEvaluadorExpertoHorasEvaluacion;
        }

        public JTextField getJTextFieldEvaluadorExpertoValorHH () {
                return jTextFieldEvaluadorExpertoValorHH;
        }

        public JTextField getJTextFieldTotalCostoEvaluacionPesos () {
                return jTextFieldTotalCostoEvaluacionPesos;
        }

        public JTextField getJTextFieldTotalCostoEvaluacionUF () {
                return jTextFieldTotalCostoEvaluacionUF;
        }

        public JTextField getJTextFieldTotalCostoReparacionPesos () {
                return jTextFieldTotalCostoReparacionPesos;
        }

        public JTextField getJTextFieldTotalCostoReparacionUF () {
                return jTextFieldTotalCostoReparacionUF;
        }

        public JTextField getJTextFieldUsuarioEvaluadorHorasEvaluacion () {
                return jTextFieldUsuarioEvaluadorHorasEvaluacion;
        }

        public JTextField getJTextFieldUsuarioEvaluadorValorHH () {
                return jTextFieldUsuarioEvaluadorValorHH;
        }

        public JTextField getJTextFieldValorOtrosCostos () {
                return jTextFieldValorOtrosCostos;
    }//GEN-LAST:event_jButtonReporteActionPerformed

        public void setJTextFieldDesarrolladorHorasReparacion (String a) {
                this.jTextFieldDesarrolladorHorasReparacion.setText (a);
        }

        public void setJTextFieldDesarrolladorValorHH (String a) {
                this.jTextFieldDesarrolladorValorHH.setText (a);
        }

        public void setJTextFieldEvaluadorExpertoHorasEvaluacion (String a) {
                this.jTextFieldEvaluadorExpertoHorasEvaluacion.setText (a);
        }

        public void setJTextFieldEvaluadorExpertoValorHH (String a) {
                this.jTextFieldEvaluadorExpertoValorHH.setText (a);
        }

        public void setJTextFieldTotalCostoEvaluacionPesos (String a) {
                this.jTextFieldTotalCostoEvaluacionPesos.setText (a);
        }

        public void setJTextFieldTotalCostoEvaluacionUF (String a) {
                this.jTextFieldTotalCostoEvaluacionUF.setText (a);
        }

        public void setJTextFieldTotalCostoReparacionPesos (String a) {
                this.jTextFieldTotalCostoReparacionPesos.setText (a);
        }

        public void setJTextFieldTotalCostoReparacionUF (String a) {
                this.jTextFieldTotalCostoReparacionUF.setText (a);
        }

        public void setJTextFieldUsuarioEvaluadorHorasEvaluacion (String a) {
                this.jTextFieldUsuarioEvaluadorHorasEvaluacion.setText (a);
        }

        public void setJTextFieldUsuarioEvaluadorValorHH (String a) {
                this.jTextFieldUsuarioEvaluadorValorHH.setText (a);
        }

        public void setJTextFieldValorOtrosCostos (String a) {
                this.jTextFieldValorOtrosCostos.setText (a);
        }

        public void calcularValores () {
                if (planillaLista) {
                        PanelPaso1 panelPaso1 = vista.getPanelPaso1 ();
                        PanelPaso2 panelPaso2 = vista.getPanelPaso2 ();
                        PanelPaso3 panelPaso3 = vista.getPanelPaso3 ();

                        float valorUF = panelPaso2.getValorUF ();
                        float valorHHEvaluadorExperto = Float.parseFloat (panelPaso3.getJTextFieldEvaluadorExpertoValorHHUF ().getText ());
                        int horasTamañoSoftware = Integer.parseInt (panelPaso1.getJTextFieldHorasTamañoSoftware ().getText ());
                        int horasUsuariosEvaluadores = Integer.parseInt (panelPaso1.getJTextFieldHorasUsuariosEvaluadores ().getText ());
                        int horasLugarEvaluacion = Integer.parseInt (panelPaso1.getJTextFieldHorasLugarEvaluacion ().getText ());
                        int horasEvaluadorExperto = horasTamañoSoftware + horasUsuariosEvaluadores + horasLugarEvaluacion;

                        float valorHHUsuarioEvaluador = Float.parseFloat (panelPaso3.getJTextFieldUsuarioEvaluadorValorHHUF ().getText ());
                        int horasUsuarioEvaluador = Integer.parseInt (panelPaso1.getJTextFieldHorasUsuariosEvaluadores ().getText ());

                        float valorOtrosCostos = Float.parseFloat (panelPaso2.getJTextFieldGastosTotalUF ().getText ());

                        float factorTiempoentrega = Float.parseFloat (panelPaso1.getJTextFieldFactorTiempoEntrega ().getText ());

                        int totalUsuarios = Integer.parseInt (panelPaso1.getJTextFieldTotalUsuarios ().getText ());

                        float totalCostoEvaluacion = (valorHHEvaluadorExperto * horasEvaluadorExperto + (valorHHUsuarioEvaluador * horasUsuarioEvaluador) * totalUsuarios) * factorTiempoentrega + valorOtrosCostos;

                        jTextFieldEvaluadorExpertoValorHH.setText ((String.valueOf (ValidaDecimal.roundNum (valorHHEvaluadorExperto))));
                        jTextFieldEvaluadorExpertoHorasEvaluacion.setText ((String.valueOf (horasEvaluadorExperto)));
                        jTextFieldUsuarioEvaluadorValorHH.setText ((String.valueOf (ValidaDecimal.roundNum (valorHHUsuarioEvaluador))));
                        jTextFieldUsuarioEvaluadorHorasEvaluacion.setText ((String.valueOf (horasUsuarioEvaluador)));
                        jTextFieldValorOtrosCostos.setText ((String.valueOf (ValidaDecimal.roundNum (valorOtrosCostos))));
                        jTextFieldTotalCostoEvaluacionUF.setText ((String.valueOf (ValidaDecimal.roundNum (totalCostoEvaluacion))));
                        jTextFieldTotalCostoEvaluacionPesos.setText ((String.valueOf ((int) (totalCostoEvaluacion * valorUF))));

                        float valorHHDesarrollador = Float.parseFloat (panelPaso2.getJTextFieldValorHHDesarrolladorUF ().getText ());
                        int horasReparacionDesarrollador = Integer.parseInt (panelPaso2.getJTextFieldHorasReparacion ().getText ());
                        int numeroDesarrolladores = Integer.parseInt (panelPaso2.getJTextFieldValorNumeroDesarrolladores ().getText ());
                        float totalCostoReparacion = valorHHDesarrollador * horasReparacionDesarrollador * numeroDesarrolladores;

                        jTextFieldDesarrolladorValorHH.setText ((String.valueOf (ValidaDecimal.roundNum (valorHHDesarrollador))));
                        jTextFieldDesarrolladorHorasReparacion.setText ((String.valueOf (horasReparacionDesarrollador)));
                        jTextFieldTotalCostoReparacionUF.setText ((String.valueOf (ValidaDecimal.roundNum (totalCostoReparacion))));
                        jTextFieldTotalCostoReparacionPesos.setText ((String.valueOf ((int) (totalCostoReparacion * valorUF))));

                        if (panelPaso1.getjRadioButtonLugarEmpresa().isSelected())
                        {
                            this.setOtrasConsideraciones1("Cliente se responsabiliza por Lugar para la Evaluación\n");
                        }
                        else if (panelPaso1.getjRadioButtonLugarArrendado().isSelected())
                        {
                            this.setOtrasConsideraciones1("Evaluador Experto se responsabiliza por Lugar para la Evaluación\n");
                        }
                        else
                        {
                            this.setOtrasConsideraciones1("No se ha especificado responsabilidad por Lugar para la Evaluación\n");
                        }

                        this.setUCE(panelPaso1.getJTextFieldUCE().getText());
                        this.setUNCE(panelPaso1.getJTextFieldUNCE().getText());
                        this.setUEX(panelPaso1.getJTextFieldUEX().getText());

                            }
        }

        public void mostrarPaneles () {
                jPanelCostoEvaluacion.setVisible (planillaLista);
                jPanelCostoReparacion.setVisible (planillaLista);
        }

        public void setPlanillaLista (boolean valor) {
                planillaLista = valor;
        }

    private void jCalendarComboFechaInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCalendarComboFechaInicioActionPerformed
                fechaInicio = (String) jCalendarComboFechaInicio.getSelectedItem ();
    }//GEN-LAST:event_jCalendarComboFechaInicioActionPerformed

    private void jCalendarComboFechaTerminoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCalendarComboFechaTerminoActionPerformed
                fechaTermino = (String) jCalendarComboFechaTermino.getSelectedItem ();
    }//GEN-LAST:event_jCalendarComboFechaTerminoActionPerformed

     public String getUCE() {
        return UCE;
    }

    public void setUCE(String UCE) {
        this.UCE = UCE;
    }

    public String getUNCE() {
        return UNCE;
    }

    public void setUNCE(String UNCE) {
        this.UNCE = UNCE;
    }

    public String getHorasSoftware() {
        return horasSoftware;
    }

    public void setHorasSoftware(String horasSoftware) {
        this.horasSoftware = horasSoftware;
    }


    public String getNumeroEvaluadores() {
        return numeroEvaluadores;
    }

    public void setNumeroEvaluadores(String numeroEvaluadores) {
        this.numeroEvaluadores = numeroEvaluadores;
    }

    public String getOtrasConsideraciones1() {
        return otrasConsideraciones1;
    }

    public void setOtrasConsideraciones1(String otrasConsideraciones1) {
        this.otrasConsideraciones1 = otrasConsideraciones1;
    }

    public String getTamSoftware() {
        return tamSoftware;
    }

    public void setTamSoftware(String tamSoftware) {
        this.tamSoftware = tamSoftware;
    }
        private void jButtonMostrarCamposActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMostrarCamposActionPerformed
                if ((vista.getJProgressBarPaso1 ().getValue () == vista.getJProgressBarPaso1 ().getMaximum ()) &&
                        (vista.getJProgressBarPaso2 ().getValue () == vista.getJProgressBarPaso2 ().getMaximum ()) &&
                        (vista.getJProgressBarPaso3 ().getValue () == vista.getJProgressBarPaso3 ().getMaximum ())) {
                        planillaLista = true;
                        calcularValores ();
                        mostrarPaneles ();
                } else {
                        TimingUtils.showTimedBalloon (new BalloonTip (jButtonMostrarCampos, "Faltan campos por llenar en los otros pasos",
                                new MinimalBalloonStyle (new Color (231, 225, 165), 2), BalloonTip.Orientation.LEFT_ABOVE,
                                BalloonTip.AttachLocation.ALIGNED, 20, 10, false), 3000);
                }
        }//GEN-LAST:event_jButtonMostrarCamposActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonMostrarCampos;
    private javax.swing.JButton jButtonReporte;
    private org.freixas.jcalendar.JCalendarCombo jCalendarComboFechaInicio;
    private org.freixas.jcalendar.JCalendarCombo jCalendarComboFechaTermino;
    private javax.swing.JLabel jLabelEvaluadorExpertoHorasEvaluacion;
    private javax.swing.JLabel jLabelEvaluadorExpertoValorHH;
    private javax.swing.JLabel jLabelFechaInicio;
    private javax.swing.JLabel jLabelFechaTermino;
    private javax.swing.JLabel jLabelReparacionDesarrolladorHorasReparacion;
    private javax.swing.JLabel jLabelReparacionDesarrolladorValorHH;
    private javax.swing.JLabel jLabelTotalCostoEvaluacionPesos;
    private javax.swing.JLabel jLabelTotalCostoEvaluacionPesos1;
    private javax.swing.JLabel jLabelTotalCostoEvaluacionUF;
    private javax.swing.JLabel jLabelTotalCostoEvaluacionUF1;
    private javax.swing.JLabel jLabelUsuarioEvaluadorHorasEvaluacion;
    private javax.swing.JLabel jLabelUsuarioEvaluadorValorHH;
    private javax.swing.JLabel jLabelValorOtrosCostos;
    private javax.swing.JPanel jPanelCostoEvaluacion;
    private javax.swing.JPanel jPanelCostoReparacion;
    private javax.swing.JPanel jPanelEvaluadorExperto;
    private javax.swing.JPanel jPanelFechas;
    private javax.swing.JPanel jPanelOtrosCostos;
    private javax.swing.JPanel jPanelReparacionDesarrollador;
    private javax.swing.JPanel jPanelTotalCostoEvaluacion;
    private javax.swing.JPanel jPanelTotalCostoReparacion;
    private javax.swing.JPanel jPanelUsuarioEvaluador;
    private javax.swing.JTextField jTextFieldDesarrolladorHorasReparacion;
    private javax.swing.JTextField jTextFieldDesarrolladorValorHH;
    private javax.swing.JTextField jTextFieldEvaluadorExpertoHorasEvaluacion;
    private javax.swing.JTextField jTextFieldEvaluadorExpertoValorHH;
    private javax.swing.JTextField jTextFieldTotalCostoEvaluacionPesos;
    private javax.swing.JTextField jTextFieldTotalCostoEvaluacionUF;
    private javax.swing.JTextField jTextFieldTotalCostoReparacionPesos;
    private javax.swing.JTextField jTextFieldTotalCostoReparacionUF;
    private javax.swing.JTextField jTextFieldUsuarioEvaluadorHorasEvaluacion;
    private javax.swing.JTextField jTextFieldUsuarioEvaluadorValorHH;
    private javax.swing.JTextField jTextFieldValorOtrosCostos;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the numeroDesarroll
     */
    public String getNumeroDesarroll() {
        return numeroDesarroll;
    }

    /**
     * @param numeroDesarroll the numeroDesarroll to set
     */
    public void setNumeroDesarroll(String numeroDesarroll) {
        this.numeroDesarroll = numeroDesarroll;
    }

    /**
     * @return the UEX
     */
    public String getUEX() {
        return UEX;
    }

    /**
     * @param UEX the UEX to set
     */
    public void setUEX(String UEX) {
        this.UEX = UEX;
    }
}
